<?php

class Gallery_model extends  CI_Model {
	/**
	 * Constructor
	 */
	function __construct()
         {
        parent::__construct();        
	}

        function _loadAll()
	{
            $this->load->database();
            $data = array();
            $data = $this->db->query("select * from gallery order by id DESC")->result_array();		                
            return $data;
	}       
        
        function _getById($id)
	{
            $this->load->database();
            $data = array();
            $data = $this->db->query("select a.*, b.nama_lengkap from gallery a left join m_user b ON(a.insert_by = b.username) where a.id = '$id' order by a.id DESC")->row_array();		                
            return $data;
	}       
}
